package com.tchhy.provider.repository.healthy

import com.tchhy.provider.repository.BaseRepository
import com.tchhy.basemodule.basedata.PeopleInfoEntity
import com.tchhy.provider.data.common.BindPh
import com.tchhy.network.retrofit.entity.request.PasswordVO
import com.tchhy.provider.api.healthyapi.TianChenHealthyApi
import com.tchhy.provider.connect.request.CallTransferReq
import com.tchhy.provider.connect.request.ConsultLineReq
import com.tchhy.provider.connect.response.CallLineUpOverRes
import com.tchhy.provider.data.common.BaseResp
import com.tchhy.provider.data.common.EmptyResp
import com.tchhy.provider.data.healthy.FamilyItem
import com.tchhy.provider.data.healthy.data.MonthPeriod
import com.tchhy.provider.data.healthy.request.*
import com.tchhy.provider.data.healthy.response.*
import com.tchhy.provider.data.partner.request.NextNoticeReq
import com.tchhy.provider.data.partner.response.DataListRes
import com.tchhy.provider.data.profit.AuthParam
import com.tchhy.provider.data.profit.response.UserIdenAuthenInfo
import com.tchhy.provider.net.RetrofitFactory
import io.reactivex.Observable
import okhttp3.RequestBody


/**
 * @author: admin
 * @date: 2019/8/20
 * @des:
 *
 **/
class HealthyRepository : BaseRepository() {
    /**
     * @description 校验验证码
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun checkCaptcha(checkCaptchaReq: CheckCaptchaReq): Observable<BaseResp<CheckCaptchaRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .checkCaptcha(getRequestJsonBody(checkCaptchaReq))
    }

    fun doorCareRefuse(req: DoorCareRefusePayReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .doorCareRefuse(getRequestJsonBody(req))
    }

    fun getDoorCareMedicalDetailCheck(
        doctorId: String?,
        projectId: String?
    ): Observable<BaseResp<GetDoorCareCheckRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getDoorCareMedicalDetailCheck(doctorId, projectId)
    }

    /**
     * @description 获取好友信息
     * @param
     * @return
     * @author admin
     * @time 2019/9/9
     */
    fun fetchFriendInfo(imUserId: String): Observable<BaseResp<ArrayList<FriendInfoRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchFriendInfo(imUserId)
    }


    /**
     * @description 获取经期列表
     * @param
     * @return
     */
    fun fetchMonthPeriod(familyRelationId: String): Observable<BaseResp<ArrayList<MonthPeriod>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchMonthPeriod(familyRelationId)
    }


    /**
     * @description 保存经期列表
     * @param
     * @return
     */
    fun saveMonthPeriod(monthPeriod: MonthPeriod): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .saveMonthPeriod(getRequestJsonBody(monthPeriod))
    }

    /**
     * @description 获取群好友信息
     * @param
     * @return
     * @author admin
     * @time 2019/9/9
     */
    fun fetchAllGroupId(groupId: String): Observable<BaseResp<ArrayList<FriendInfoRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchAllGroupId(groupId)
    }


    /**
     * @description 获取群好友信息
     * @param
     * @return
     * @author admin
     * @time 2019/9/9
     */
    fun completeInfo(completeUserInfoVO: CompleteUserInfoVO): Observable<BaseResp<PeopleInfoEntity>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .completeInfo(getRequestJsonBody(completeUserInfoVO))
    }


    /**
     * app添加药箱留言
     */
    fun addMedicineChestRemindMsg(addMedicineRemainReq: AddMedicineRemainReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .addMedicineChestRemindMsg(getRequestJsonBody(addMedicineRemainReq))
    }

    /**
     * 投诉圈子
     */
    fun complaintGroup(complaintCircleReq: ComplaintCircleReq): Observable<BaseResp<Any>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .complaintGroup(getRequestJsonBody(complaintCircleReq))
    }


    /**
     * 举报好友
     */
    fun complaintFriend(complaintFriendReq: ComplaintFriendReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .complaintFriend(getRequestJsonBody(complaintFriendReq))
    }

    /**
     * @description 获取好友信息
     * @param
     * @return
     * @author admin
     * @time 2019/9/9
     */
    fun fetchFriendInCircleInfo(
        imUserId: String,
        groupIdIm: String
    ): Observable<BaseResp<ArrayList<FriendInfoRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchFriendInCircleInfo(imUserId, groupIdIm)
    }

    /**
     * @description 获取圈子详情
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun getCircleDetail(groupIdIm: String): Observable<BaseResp<CircleDetailRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getCircleDetail(groupIdIm)
    }

    /**
     * @description 获取好友申请列表
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun getFriendApplyList(
        imUserId: String, pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<FriendApplyItem>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getFriendApplyList(imUserId, pageNum, pageSize)
    }


    /**
     * @description 获取圈子标签列表
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun getCircleTag(
    ): Observable<BaseResp<ArrayList<CircleTagEntity>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getCircleTag()
    }


    /**
     * @description 圈子主页加关注数
     * @param
     * @return
     */
    fun groupAddCount(groupIdIm: String): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .groupAddCount(groupIdIm)
    }

    /**
     * @description 用户创建的圈子
     * @param
     * @return
     */
    fun userCreatedGroup(userId: String, pageSize: Int, pageNum: Int): Observable<BaseResp<DataListRes<CircleDisplayItem>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .userCreatedGroup(userId, pageSize, pageNum)
    }

    /**
     * @description 是否可以私信
     * @param
     * @return
     */
    fun privateMessage(buyUserId: String, serviceUserId: String): Observable<BaseResp<Boolean>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .privateMessage(buyUserId, serviceUserId)
    }

    /**
     * @description 推荐好友
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun fetchRecommendFriends(): Observable<BaseResp<ArrayList<RecommendFriendRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchRecommendFriends()
    }


    /**
     * @description 同意好友申请以及群申请
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun agreeFriendApply(
        agreeFriendApplyReq: AgreeFriendApplyReq
    ): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .agreeFriendApply(getRequestJsonBody(agreeFriendApplyReq))
    }

    fun setJoinConfirm(
        setJoinConfimReq: SetJoinConfimReq
    ): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .setJoinConfirm(getRequestJsonBody(setJoinConfimReq))
    }

    /**
     * @description 添加好友
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun addFriend(addFriendReq: AddFriendReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .addFriend(getRequestJsonBody(addFriendReq))
    }

    /**
     * @description 创建群
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun createCircle(createCircleReq: CreateCircleReq): Observable<BaseResp<CircleDetailRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .createCircle(getRequestJsonBody(createCircleReq))
    }

    /**
     * @description 搜索用户
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun searchFriend(param: String): Observable<BaseResp<MyFriendItem>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .searchFriend(param)
    }

    /**
     * @description 搜索附近圈子
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun searchNearbyCircle(
        lat: Double?, lng: Double?,
        search_key: String
    ): Observable<BaseResp<ArrayList<CircleDisplayItem>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .searchNearbyCircle(lat, lng, search_key)
    }

    /**
     * @description 退出圈子
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun logoutCircle(
        groupIdIm: String
    ): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .logoutCircle(groupIdIm)
    }

    /**
     * @description 推荐圈子
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun recommendCircles(
    ): Observable<BaseResp<ArrayList<CircleDisplayItem>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .recommendCircles()
    }

    /**
     * @description 检查是否被禁言
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun checkIsForbidden(groupIdIm: String): Observable<BaseResp<Int>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .checkIsForbidden(groupIdIm)
    }

    fun translateConfirm(
        currentType: String?,
        forwardType: String?,
        groupId: String?,
        toGroupId: String?,
        toUserId: String?
    ): Observable<BaseResp<Boolean?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .translateConfirm(currentType, forwardType, groupId, toGroupId, toUserId)
    }

    fun shareConfirm(
        forwardType: String?,
        toGroupId: String?,
        toUserId: String?
    ): Observable<BaseResp<Boolean?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .shareConfirm( forwardType, toGroupId, toUserId)
    }

    /**
     * @description 全部圈子
     * @param
     * @return
     * @author admin
     * @time 2019/9/9
     */
    fun fetchAllCircles(
        lat: Double?,
        lng: Double?,
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<CircleDisplayItem>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchAllCircles(lat, lng, pageNum, pageSize)
    }

    /**
     * @description 修改群个人名称
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun updateNickNameInCircle(updateCircleMemberNameReq: UpdateCircleMemberNameReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .updateNickNameInCircle(getRequestJsonBody(updateCircleMemberNameReq))
    }

    /**
     * @description 修改群名称
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun changCircleName(updateCircleMetaInfoReq: UpdateCircleMetaInfoReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .changCircleName(getRequestJsonBody(updateCircleMetaInfoReq))
    }


    /**
     * @description 我的圈子
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun fetchMyCircle(): Observable<BaseResp<ArrayList<CircleDisplayItem>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchMyCircle()
    }

    /**
     * @description 我的朋友
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun fetchMyFriend(
        imUserId: String,
        medicineBoxId: String
    ): Observable<BaseResp<ArrayList<MyFriendItem>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchMyFriend(imUserId, medicineBoxId)
    }

    /**
     * @description 修改群简介
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun changeCircleSummary(updateCircleMetaInfoReq: UpdateCircleMetaInfoReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .changeCircleSummary(getRequestJsonBody(updateCircleMetaInfoReq))
    }
    fun changeCircleInfo(updateCircleMetaInfoReq: UpdateCircleMetaInfoReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .changeCircleInfo(getRequestJsonBody(updateCircleMetaInfoReq))
    }
    fun groupTypeChange(request: GroupTypeChangeReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .groupTypeChange(getRequestJsonBody(request))
    }

    fun groupTyeChangeJudgment(groupIdIm: String?, type: Int): Observable<BaseResp<Boolean?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .groupTyeChangeJudgment(groupIdIm, type)
    }

    /**
     * @description 发送验证码
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun sendCaptcha(captchaReq: CaptchaReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .sendCaptcha(getRequestJsonBody(captchaReq))
    }


    /**
     * @description 登录
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun login(loginReq: LoginReq): Observable<BaseResp<PeopleInfoEntity>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .onLogin(getRequestJsonBody(loginReq))
    }


    /**
     * @description 发送验证码
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun sendCaptcha(smsVO: SmsVO): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .sendCaptcha(getRequestJsonBody(smsVO))
    }


    /**
     * @description 微信绑定
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun bindphone(bindPh: BindPh): Observable<BaseResp<PeopleInfoEntity>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .bindphone(getRequestJsonBody(bindPh))
    }

    /**
     * @description 重置密码
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun forgetPassword(passwordVO: PasswordVO): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .forgetPassword(getRequestJsonBody(passwordVO))
    }

    /**
     * @description 获取家庭列表
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun fetchFamilyList(id: String): Observable<BaseResp<ArrayList<FamilyItem>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchFamilyList(id)
    }

    /**
     * @description 获取兴趣标签
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun fetchTag(): Observable<BaseResp<ArrayList<InterestEntry>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchTag()
    }

    /**
     * @description 新增家庭成员
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun joinFamily(familyMemberShipReq: FamilyMemberShipReq): Observable<BaseResp<ActiveChestRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .joinFamily(getRequestJsonBody(familyMemberShipReq))
    }

    /**
     * @description 短信提醒创建账号
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun addUserBySms(id: String, phone: String, code: String): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .addUserBySms(id, phone, code)
    }

    /**
     * @description 获取家庭个人详情
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun fetchFamilyUserInfo(id: String): Observable<BaseResp<PersonDetailInfoRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchFamilyUserInfo(id)
    }

    fun quitFamily(familyId: String): Observable<BaseResp<String>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .quitFamily(familyId)
    }

    /**
     * @description 关注内容
     */
    fun fetchFocusContents(
        type: Int,
        familyRelationId: String?,
        authorId: String?,
        healthIndex: ArrayList<String>?,
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<ContentBaseEntity>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchFocusContents(type, familyRelationId, authorId, healthIndex, pageNum, pageSize)
    }

    /**
     *判断当前用户是否填写兴趣标签
     */
    fun checkUserAddTagResult(): Observable<BaseResp<Boolean>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .checkUserAddTagResult()
    }

    /**
     * 判断当前用户是否关注过其他用户
     */
    fun isFollowPeople(): Observable<BaseResp<Boolean>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .isFollowPeople()
    }

    /**
     * 判断当前用户是否关注过其他用户
     */
    fun isFollowSomeone(other: Long?): Observable<BaseResp<FollowedRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .isFollowSomeone(other)
    }

    /**
     * @description新增标签
     * */
    fun addTag(addMyFavoriteTag: AddMyFavoriteTag): Observable<BaseResp<Boolean>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .addTag(getRequestJsonBody(addMyFavoriteTag))
    }

    /**
     * 给用户推荐内容
     */
    fun recommendContent(
        familyId: String,
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<ContentBaseEntity>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .recommendContent(familyId, pageNum, pageSize)
    }

    /**
     * 根据标签火圈内容
     */
    fun fetchContentsByTag(
        tag: String,
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<ContentBaseEntity>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchContentsByTag(tag, pageNum, pageSize)
    }

    /**
     * 给用户推荐内容
     */

    fun deletePublishContent(
        contentId: String
    ): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .deletePublishContent(contentId)
    }

    /**
     * 同城推荐
     */
    fun fetchLocalCityContent(
        type: Int,
        areaId: String,
        lat: String,
        lng: String,
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<ContentBaseEntity>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchLocalCityContent(type, areaId, lat, lng, pageNum, pageSize)
    }


    /**
     * 收藏的内容
     */
    fun fetchCollectContents(
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<ContentBaseEntity>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchCollectContents(pageNum, pageSize)
    }


    /**
     * 收藏的内容
     */
    fun fetchHealthIndex(id: String): Observable<BaseResp<ArrayList<String>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchHealthIndex(id)
    }

    /**
     * 获取最后一条发布内容
     */
    fun getLastContent(): Observable<BaseResp<ContentBaseEntity>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getLastContent()
    }

    /**
     * LAST_WATCH_CONTENTS
     */
    fun lastContents(): Observable<BaseResp<DataListRes<ContentBaseEntity>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .lastContents()
    }

    /**
     * @description 编辑个人详情
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun updateProfileDetail(editUserProfile: EditUserProfile): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .updateProfileDetail(getRequestJsonBody(editUserProfile))

    }

    /**
     * @description 根据用户主键获取关注数量 */
    fun fetchAllFansFocusNum(): Observable<BaseResp<UserFansOrFacusNumEntity>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchAllFansFocusNum()
    }


    fun complaintUseFeedback(useComplaint: UseComplaint): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .complaintUseFeedback(getRequestJsonBody(useComplaint))
    }

    /**
     * @description 添加举报内容
     * @param
     * @return
     */
    fun addComplaintContent(complaintContent: ComplaintContent): Observable<BaseResp<Boolean>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .addComplaintContent(getRequestJsonBody(complaintContent))
    }

    fun getIsCanShare(contentId: String?): Observable<BaseResp<Boolean>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getIsCanShare(contentId)
    }

    /**
     * @description 获取个人主页的内容列表
     * @param
     * @return
     */
    fun fetchPeopleContentList(
        authorId: String, type: Int, pageNum: Int, pageSize: Int
    ): Observable<BaseResp<DataListRes<PersonContentSummary>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchPeopleContentList(authorId, type, pageNum, pageSize)
    }


    /**
     * @description 关注用户
     * @param
     * @return
     */
    fun followPeople(
        focusPeopleReq: FocusPeopleReq
    ): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .followPeople(getRequestJsonBody(focusPeopleReq))
    }

    /**
     * @description 修改家庭名称
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun setFamilyName(editId: Long, familyId: String, familyName: String): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .setFamilyName(editId, familyId, familyName)
    }


    /**
     * @description 激活药箱
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun activityMedicineBox(activeChestReq: ActiveChestReq): Observable<BaseResp<ActiveMedicineRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .activityMedicineBox(getRequestJsonBody(activeChestReq))
    }

    /**
     * @description 获取药箱连接状态
     * @param
     * @return
     * @author admin
     * @time 2019/10/16
     */
    fun getMedicineConnectionStatus(familyId: String): Observable<BaseResp<KitConnectionStatusRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getMedicineConnectionStatus(familyId)
    }


    /**
     * @description 设置默认家庭
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun setDefaultFamily(editId: Long, familyId: String, id: Long): Observable<BaseResp<Long>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .setDefaultFamily(editId, familyId, id)
    }

    /**
     * @description 解除药箱关系
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun deleteMemberOfChest(id: String): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .deleteMemberOfChest(id)
    }

    /**
     * @description 获取药箱详情
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun fetchMedicineBox(
        editId: Long,
        medicineCode: String
    ): Observable<BaseResp<MedicineBoxInfo>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchMedicineBox(editId, medicineCode)
    }

    /**
     * @description 呼叫药箱
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    /*fun callMedicienChest(
        medicineVideoConversationReq: MedicineVideoConversationReq
    ): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .callMedicienChest(getRequestJsonBody(medicineVideoConversationReq))
    }*/

    /**
     * @description 关闭聊天
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    /*fun closeChat(
        closeChatReq: CloseChatReq
    ): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .closeChat(getRequestJsonBody(closeChatReq))
    }*/

    /**
     * @description 搜索标签
     * @param
     * @return
     * @author admin
     * @time 2019/10/23
     */
    fun searchTag(keyWord: String?): Observable<BaseResp<SearchTagRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .searchTag(keyWord)
    }

    fun searchTagForContent(keyWord: String?): Observable<BaseResp<SearchTagRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .searchTagForContent(keyWord)
    }

    /**
     * @description 查看我所有发布的内容
     * @param
     * @return
     * @author admin
     * @time 2019/10/23
     */
    fun fetchMyContent(
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<ContentBaseEntity>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchMyContent(pageNum, pageSize)
    }


    /**
     * @description 获取粉丝列表
     * @param
     * @return
     */
    fun fetchFansList(
        authorId: String,
        pageNum: Int, pageSize: Int
    ): Observable<BaseResp<DataListRes<ContentPeopleHeadSummary>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchFansList(authorId, pageNum, pageSize)
    }

    /**
     * @description 获取关注用户列表
     * @param
     * @return
     */
    fun fetchFollowList(
        authorId: String,
        pageNum: Int, pageSize: Int
    ): Observable<BaseResp<DataListRes<ContentPeopleHeadSummary>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchFollowList(authorId, pageNum, pageSize)
    }

    /**
     * @description 我看过的内容
     * @param
     * @return
     * @author admin
     * @time 2019/10/23
     */
    fun fetchlastWatchContent(
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<ContentBaseEntity>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchlastWatchContent(pageNum, pageSize)
    }

    /**
     * @description 取消关注
     * @param
     * @return
     */
    fun cancelFocus(
        authorId: String,
        followAuthorId: String
    ): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .cancelFocus(authorId, followAuthorId)
    }

    /**
     * @description 新增多媒体内容
     * @param
     * @return
     * @author admin
     * @time 2019/10/23
     */
    fun addMutiMedia(contentBaseEntity: ContentBaseEntity): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .addMutiMedia(getRequestJsonBody(contentBaseEntity))
    }

    /**
     * @description 获取家庭成员列表
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun fetchAllFamilyMember(
        editId: Long,
        familyId: String,
        id: Long
    ): Observable<BaseResp<ArrayList<FamilyMemberShipItem>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchAllFamilyMember(editId, familyId, id)
    }

    fun fetchAllFamilyMember2(
        editId: Long,
        familyId: String,
        id: Long
    ): Observable<BaseResp<ArrayList<FamilyMemberShipItem>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchAllFamilyMember2(editId, familyId, id)
    }


    /**
     * @description 通知药箱二维码扫描成功
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun notifyMedicineBox(
        timeCode: String,
        editId: Long,
        medicineCode: String
    ): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .notifyMedicineBox(timeCode, editId, medicineCode)
    }

    /**
     * @description 通过扫描添加家庭成员
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun addFamilyMemberByScan(activeFamilyMemberByScan: ActiveFamilyMemberByScan): Observable<BaseResp<ActiveChestRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .addFamilyMemberByScan(getRequestJsonBody(activeFamilyMemberByScan))
    }

    /**
     * @description 获取im个人主页
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun getImInfo(
        imUserId: String, familyId: String
    ): Observable<BaseResp<FriendInfoNewRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getImInfo(imUserId, familyId)
    }

    /**
     * @description 获取个人信息
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun getImUserInfo(
        imUserId: String
    ): Observable<BaseResp<ChatPersonInfo>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getImUserInfo(imUserId)
    }

    /**
     * @description 绑定药箱
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun bindingMedicine(
        timeCode: String,
        editId: Long,
        medicineCode: String,
        type: Int
    ): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .bindingMedicine(timeCode, editId, medicineCode, type)
    }


    /**
     * @description 修改备注名
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun updateRemarkName(updateRemarkNameReq: UpdateRemarkNameReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .updateRemarkName(getRequestJsonBody(updateRemarkNameReq))
    }


    /**
     * @description 体重最近7次记录
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun fetchWeightRecordList(
        editId: Long,
        familyRelationId: String
    ): Observable<BaseResp<ArrayList<WeightItemRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchWeightRecordList(editId, familyRelationId)
    }


    /**
     * @description 保存身高体重
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun saveWeightRecord(weightItemReq: WeightItemReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .saveWeightRecord(getRequestJsonBody(weightItemReq))
    }


    /**
     * @description 步数最近7次记录
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun fetchStepRecordList(
        editId: Long,
        familyRelationId: Long
    ): Observable<BaseResp<ArrayList<StepRecordRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchStepRecordList(editId, familyRelationId)
    }


    /**
     * @description 保存步数
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun saveStepRecord(stepRecordRes: StepRecordRes): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .saveStepRecord(getRequestJsonBody(stepRecordRes))
    }


    /**
     * @description 获取用户家庭排行
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun fetchRankByStep(
        editId: Long,
        familyRelationId: Long
    ): Observable<BaseResp<ArrayList<FamilyMemberRankItem>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchRankByStep(editId, familyRelationId)

    }


    /**
     * @description 获取血压最近记录
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun fetchBloodPressureRecordList(
        editId: Long,
        familyRelationId: Long
    ): Observable<BaseResp<ArrayList<BloodPressureItemRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchBloodPressureRecordList(editId, familyRelationId)
    }

    /**
     * @description 保存血压
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun saveBloodPressureRecord(bloodPressureReq: BloodPressureReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .saveBloodPressureRecord(getRequestJsonBody(bloodPressureReq))
    }

    /**
     * @description 获取血糖最近记录
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun fetchBloodSugarRecordList(
        editId: Long,
        familyRelationId: Long
    ): Observable<BaseResp<ArrayList<BloodSugarItem>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchBloodSugarRecordList(editId, familyRelationId)
    }

    /**
     * @description 保存血糖
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun saveBloodSugarRecord(bloodSugarReq: BloodSugarReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .saveBloodSugarRecord(getRequestJsonBody(bloodSugarReq))
    }

    /**
     * @description app用户健康档案
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun fetchUserHealthData(
        familyRelationId: String
    ): Observable<BaseResp<HealthFileDataRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchUserHealthData(familyRelationId)
    }

    /**
     * 获取健康指数详情
     */
    fun getHealthScoreDetail(
        familyRelationId: Long
    ): Observable<BaseResp<HealthScoreDetailRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getHealthScoreDetail(familyRelationId)
    }


    /**
     * @descriptionapp app首页用户画像
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun fetchMainPageUserPortrait(
        familyRelationId: String
    ): Observable<BaseResp<ArrayList<MainPageUserInfo>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchMainPageUserPortrait(familyRelationId)
    }


    /**
     * @description 健康记录分页
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun fetchHealthRecordList(
        editId: Long,
        familyRelationId: String,
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<HealthRecordItem>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchHealthRecordList(editId, familyRelationId, pageNum, pageSize)
    }


    /**
     * @description 手动增加健康记录
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun addHealthRecord(healthRecordItem: HealthRecordItem): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .addHealthRecord(getRequestJsonBody(healthRecordItem))
    }

    /**
     * @description 健康评估问卷列表
     * @param
     * @return
     * @author admin
     * @time 2019/9/9
     */
    fun fetchQuestionList(
        editId: Long,
        familyRelationId: Long
    ): Observable<BaseResp<ArrayList<QuestionItem>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchQuestionList(editId, familyRelationId)
    }


    /**
     * @description 获取是否可以一键补药
     */
    fun getIsTonic(
        kitNo: String
    ): Observable<BaseResp<Boolean>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getIsTonic(kitNo)
    }

    fun oneKeySupplement(
        oneKeySupplementReqInfo: OneKeySupplementReqInfo
    ): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .oneKeySupplement(getRequestJsonBody(oneKeySupplementReqInfo))
    }

    /**
     * @description 获取分类
     * @param
     * @return
     * @author admin
     * @time 2019/9/9
     */
    fun fetchCategoryList(
        editId: String,
        coding: String,
        type: String?
    ): Observable<BaseResp<ArrayList<MedicineCategoryItem>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchCategoryList(editId, coding, type)
    }

    /**
     * @description 根据69码获取药品信息
     * @param
     * @return
     * @author admin
     * @time 2019/9/9
     */
    fun fetchMedicineInfoByScan(
        editId: String,
        barCode: String
    ): Observable<BaseResp<MedicineInfo>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchMedicineInfoByScan(editId, barCode)
    }


    /**
     * @description 根据药品名称获取药品信息
     * @param
     * @return
     * @author admin
     * @time 2019/9/9
     */
    fun fetchMedicineInfoByName(
        editId: String, drugsName: String, pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<MedicineInfo>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchMedicineInfoByName(editId, drugsName, pageNum, pageSize)
    }


    /**
     * @description 返回全部药品分类
     * @param
     * @return
     * @author admin
     * @time 2019/9/9
     */
    fun fetchAllMedicineCategory(editId: String): Observable<BaseResp<ArrayList<MedicineTypeRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchAllMedicineCategory(editId)
    }

    /**
     * @description 药品详情
     * @param
     * @return
     * @author admin
     * @time 2019/9/9
     */
    fun fetchMedicineDisplay(
        medicineChestNo: String, medicineId: String, type: Int
    ): Observable<BaseResp<MedicineInfo>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getMedicineDetail(medicineChestNo, medicineId, type)
    }

    /**
     * @description 药物展示公共接口
     * @param
     * @return
     * @author admin
     * @time 2019/9/9
     */
    fun fetchMedicineDisplay(
        coding: String, key: String?, medicineTypeCode: String?, type: String?
    ): Observable<BaseResp<MedicinesSourceList>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getMedicineDetail(coding, key, medicineTypeCode, type)
    }


    /**
     * @description 添加自储药
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun addStockMedicine(medicineInfo: MedicineReqInfo): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .addStockMedicine(getRequestJsonBody(medicineInfo))
    }


    /**
     * @description 得到所有以及分页查询药品
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun fetchAllMedicines(
        editId: String, medicineName: String?,
        pageNum: Int, pageSize: Int, typeName: String
    ): Observable<BaseResp<DataListRes<MedicineEntity>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchAllMedicines(editId, medicineName, pageNum, pageSize, typeName)
    }

    /**
     * @description 删除自储药
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun deleteUserMedicine(esId: String, id: String): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .deleteUserMedicine(getRequestJsonBody(DeleteMedicineReq(esId, id)))
    }

    /**
     * @description 获得首次配药或者推荐用药的json
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun fetchMedicationList(
        editId: String,
        familyId: String?,
        meetId: String?, type: Int
    ): Observable<BaseResp<ArrayList<MedicineDosageEntity>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fetchMedicationList(editId, familyId, meetId, type)
    }


    /**
     * @description 获得首次配药或者推荐用药的json
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun setFirstDosage(
        firstDosageReq: FirstDosageReq
    ): Observable<BaseResp<ArrayList<String>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .setFirstDosage(getRequestJsonBody(firstDosageReq))
    }

    /**
     * 用药提醒服药
     */
    fun takeMedicine(takeMedicineReq: TakeMedicineReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .takeMedicine(getRequestJsonBody(takeMedicineReq))
    }


    /**
     * @description 内容操作
     * @param
     * @return
     * @author admin
     * @time 2019/10/23
     */
    fun contentOpeartion(contentOperationReq: ContentOperationReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .contentOpeartion(getRequestJsonBody(contentOperationReq))
    }

    /**
     * 用药提醒结束服药
     */
    fun endTakeMedicine(endTakeMedicineReq: EndTakeMedicineReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .endTakeMedicine(getRequestJsonBody(endTakeMedicineReq))
    }


    fun getFamilyMember(
        familyId: String,
        id: String
    ): Observable<BaseResp<ArrayList<FamilyMemberData>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getFamilyMember(familyId, id)
    }

    /**
     * 获取用药计划详情
     */
    fun getPlanDetails(
        appMedicationTime: String,
        medicationPlanId: String
    ): Observable<BaseResp<java.util.ArrayList<TakeMedicineRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getPlanDetails(appMedicationTime, medicationPlanId)
    }

    /**
     * 用药提醒判断是否可以延后
     */
    fun judgeNextNoticeTime(nextNoticeReq: NextNoticeReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .judgeNextNoticeTime(getRequestJsonBody(nextNoticeReq))
    }

    /**
     * @description 计算用药天数
     * @param
     * @return
     * @author admin
     * @time 2019/10/29
     */
    fun calculateMedicationPlan(planData: MedicinePlanReq): Observable<BaseResp<ArrayList<DrinkDrugsPlanData>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .calculateMedicineDays(getRequestJsonBody(planData))
    }

    /**
     * @description 创建用药计划
     * @param
     * @return
     * @author admin
     * @time 2019/10/29
     */
    fun createMedicationPlan(data: CreateMedicationPlanData): Observable<BaseResp<String>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .createMedicationPlan(getRequestJsonBody(data))
    }

    fun getKitTemperatureHumidity(medicinalCode: String): Observable<BaseResp<KitStatusRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getKitTemperatureHumidity(medicinalCode)
    }

    fun getClassification(
        coding: String,
        type: String
    ): Observable<BaseResp<ArrayList<DrugClassificationRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getClassification(coding, type)

    }


    /**
     * @description 判断发布内容权限
     * @param
     * @return
     * @author admin
     * @time 2019/10/30
     */
    fun contentAuthority(
    ): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .contentAuthority()
    }


    fun quickMedicineCommonList(
        coding: String,
        key: String?,
        medicineTypeCode: String,
        type: String?
    ): Observable<BaseResp<AllMedicationRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .quickMedicineCommonList(coding, key, medicineTypeCode, type)
    }

    fun checkUpdate(): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .checkUpdate()
    }

    fun getCardNumBelongToBank(cardNumber: String): Observable<BaseResp<String>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getCardNumBelongToBank(cardNumber)
    }

    fun addBankCard(addBankCardReq: AddBankCardReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .addBankCard(getRequestJsonBody(addBankCardReq))
    }

    /**
     * @description 修改IM备注名
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun updateFriendRemarkName(updateFriendRemarkReq: UpdateFriendRemarkReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .updateFriendRemarkName(getRequestJsonBody(updateFriendRemarkReq))
    }


    /**
     * @description 邀请好友入群
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun inviteFriendsInCircle(
        inviteFriendReq: InviteFriendReq
    ): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .inviteFriendsInCircle(getRequestJsonBody(inviteFriendReq))
    }

    /**
     * @description 删除群中好友
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun removeFriendInCircle(
        removeFriendReq: RemoveFriendReq
    ): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .removeFriendInCircle(getRequestJsonBody(removeFriendReq))
    }


    /**
     * @description 修改IM备注名
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    fun joinCircle(groupIdIm: String): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .joinCircle(groupIdIm)
    }


    /**
     * @description 是否允许换药
     */
    fun getIsAllowChangeMedicine(
        chestCode: String
    ): Observable<BaseResp<Boolean>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getIsAllowChangeMedicine(chestCode)
    }

    /**
     * 获得更换药品类型列表
     */
    fun getMedicineTypeList(
        chestCode: String,
        typeCode: String?
    ): Observable<BaseResp<MedicineChangeTypeListRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getMedicineTypeList(chestCode, typeCode)
    }

    /**
     * @description 获取商品库的药品信息
     */

    fun getMedicineTarget(
        typeCode: String?,
        size: String?,
        pageNum: Int?,
        pageSize: Int?
    ): Observable<BaseResp<MedicineTargetRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getMedicineTarget(
                typeCode,
                size,
                pageNum,
                pageSize
            )
    }

    /**
     * @description 换药订单详情
     */
    fun getChangeMedicineOrderDetail(
        replaceOrderId: String
    ): Observable<BaseResp<ChangeMedicineOrderDetailRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getChangeMedicineOrderDetail(replaceOrderId)
    }

    /**
     * @description 换药订单列表
     */

    fun getChangeMedicineOrders(
        chestCode: String,
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<ChangeMedicineOrdersRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getChangeMedicineOrders(
                chestCode,
                pageNum,
                pageSize
            )
    }

    /**
     * @description 提交换药
     */
    fun submitChangeMedicine(
        submitChangeMedicineReq: SubmitChangeMedicineReq
    ): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .submitChangeMedicine(getRequestJsonBody(submitChangeMedicineReq))
    }

    /**
     * @description 获取目标药品类型
     */
    fun getTargetMedicineType(
    ): Observable<BaseResp<List<TargetMedicineTypeRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getTargetMedicineType()
    }


    /**
     * @description 换药订单列表
     */

    fun getScanCode(
        content: Boolean,
        id: String
    ): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getScanCode(content, id)
    }

    /**
     * @description 获取一级分类
     */
    fun getMarketFirstPage(type: Int): Observable<BaseResp<List<MarketFirstTypeRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getMarketFirstPage(type)
    }

    fun getMarketGoodsByType(
        pageNum: Int,
        pageSize: Int, firstTypeName: String,
        type: Int,
        secondTypeName: String?
    ): Observable<BaseResp<MarketGoodsRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getMarketGoodsByType(pageNum, pageSize, firstTypeName, type, secondTypeName)
    }

    fun getMarketSecondKinds(firstTypeName: String): Observable<BaseResp<List<MarketFirstTypeRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getMarketSecondKinds(firstTypeName)
    }

    fun getGoodsDetail(commodityId: String): Observable<BaseResp<MarketGoodsDetail>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getGoodsDetail(commodityId)
    }

    //购物车接口
    fun getBuyCarCount(familyRelationId: String): Observable<BaseResp<Long>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getBuyCarCount(familyRelationId)
    }

    fun deleteBuyCarList(shoppingCartIds: String): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .deleteBuyCarList(shoppingCartIds)
    }

    fun addBuyCarData(addBuyCarReq: AddBuyCarReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .addBuyCarData(getRequestJsonBody(addBuyCarReq))
    }

    fun getBuyCarList(
        familyRelationId: Long, pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<BuyCarListBean>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getBuyCarList(familyRelationId, pageNum, pageSize)
    }

    fun editBuyCar(editBuyCayReq: EditBuyCayReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .editBuyCar(getRequestJsonBody(editBuyCayReq))
    }

    fun getMarketSearch(
        salesName: String, pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<MarketGoodsRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getMarketSearch(salesName, pageNum, pageSize)
    }

    fun getMarketSearchRecommend(
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<MarketGoodsRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getMarketSearchRecommend(pageNum, pageSize)
    }


    fun addNewAddress(addAddressReq: AddAddressReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .addNewAddress(getRequestJsonBody(addAddressReq))
    }

    fun getDefaultAddress(): Observable<BaseResp<DefaultAddressRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getDefaultAddress()
    }

    fun getAddressDetail(consigneeAddressId: String): Observable<BaseResp<AddressDetailRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getAddressDetail(consigneeAddressId)
    }

    fun getAddressList(): Observable<BaseResp<List<AddressListRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getAddressList()
    }

    fun setDefaultAddress(setAddressReq: SetAddressReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .setDefaultAddress(getRequestJsonBody(setAddressReq))
    }

    fun updateAddress(updateAddressReq: AddAddressReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .updateAddress(getRequestJsonBody(updateAddressReq))
    }

    fun deleteAddress(consigneeAddressId: Long?): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .deleteAddress(consigneeAddressId)
    }

    fun getFreight(freightReq: FreightReq): Observable<BaseResp<Float>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getFreight(getRequestJsonBody(freightReq))
    }

    fun checkStatus(freightReq: FreightReq): Observable<BaseResp<List<CheckStatusRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .checkStatus(getRequestJsonBody(freightReq))
    }


    fun exchangeProduct(exchangeProductReq: ExchangeProductReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .exchangeProduct(getRequestJsonBody(exchangeProductReq))
    }

    fun getOrderByByAccount(
        exchangeAccount: String,
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<OrdersLisrRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getOrderByByAccount(exchangeAccount, pageNum, pageSize)
    }

    fun getPointProductDetail(id: String): Observable<BaseResp<OrderDetailRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getPointProductDetail(id)
    }

    fun getPointsMessage(familyId: String): Observable<BaseResp<PointSaveRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getPointsMessage(familyId)
    }

    fun getPointsProductList(
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<PointsListRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getPointsProductList(pageNum, pageSize)
    }

    fun getRecords(
        familyId: String,
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<EnvironmentalProRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getRecords(familyId, pageNum, pageSize)
    }

    fun updateByOrderNum(confirmReceiveReq: ConfirmReceiveReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .updateByOrderNum(getRequestJsonBody(confirmReceiveReq))
    }


    fun createOrder(createOrderReq: CreateOrderReq): Observable<BaseResp<CreateOrderRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .createOrder(getRequestJsonBody(createOrderReq))
    }

    fun getDays(getDaysReq: ArrayList<GetDaysReq>): Observable<BaseResp<GetDaysRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getDays(getRequestJsonBody(getDaysReq))
    }

    fun medicineChestAddress(
        familyId: String,
        mallPrice: String
    ): Observable<BaseResp<MedCheseRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .medicineChestAddress(familyId, mallPrice)
    }

    fun payOrder(payOrderReq: CreateOrderRes): Observable<BaseResp<String>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .payOrder(getRequestJsonBody(payOrderReq))
    }


    fun refusePay(refusePayReq: CreateOrderRes): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .refusePay(getRequestJsonBody(refusePayReq))
    }

    fun selectEshopItem(orderNum: String): Observable<BaseResp<SelectedItemRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .selectEshopItem(orderNum)
    }

    fun selectMedicineItem(orderNum: String): Observable<BaseResp<SelectedItemRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .selectMedicineItem(orderNum)
    }

    fun selectEshopMedicineSell(
        createrId: String,
        endTime: String,
        familyId: String,
        orderNum: String,
        pageNum: Int,
        pageSize: Int,
        startTime: String
    ): Observable<BaseResp<OrderLisrRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .selectEshopMedicineSell(
                createrId,
                endTime,
                familyId,
                orderNum,
                pageNum,
                pageSize,
                startTime
            )
    }

    fun cancelOrder(cancelOrderReq: CancelOrderReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .cancelOrder(getRequestJsonBody(cancelOrderReq))
    }

    fun deleteOrder(cancelOrderReq: CancelOrderReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .deleteOrder(getRequestJsonBody(cancelOrderReq))
    }

    fun confirmReceived(cancelOrderReq: CancelOrderReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .confirmReceived(getRequestJsonBody(cancelOrderReq))
    }

    fun joinQueue(consultLineReq: ConsultLineReq): Observable<BaseResp<CallLineUpOverRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .joinQueue(getRequestJsonBody(consultLineReq))
    }

    fun joinTransferQueue(request: CallTransferReq): Observable<BaseResp<CallLineUpOverRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .joinTransferQueue(getRequestJsonBody(request))
    }

    fun getQueueResult(
        type: Int,
        doctorTableId: String?,
        departmentId: Long?,
        doctorId: Long?,
        userId: Long?
    ): Observable<BaseResp<CallLineUpOverRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getQueueResult(type, doctorTableId, departmentId, doctorId, userId)
    }

    fun getConsultationResult(
        ringletterId: String,
        familyId: String
    ): Observable<BaseResp<ConsultationResponse>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getConsultationResult(ringletterId, familyId)
    }


    fun getMedicineOrders(
        createrId: String,
        endTime: String,
        familyId: String,
        orderNum: String,
        pageNum: Int,
        pageSize: Int,
        startTime: String
    ): Observable<BaseResp<MedicineListRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getMedicineOrders(createrId, endTime, familyId, orderNum, pageNum, pageSize, startTime)
    }

    fun searchMedicine(
        coding: String,
        salesName: String,
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<UseSearchResult>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .searchMedicine(coding, salesName, pageNum, pageSize)
    }

    //广告类型(1-启动图、2-闪屏、3-首页banner、4-健康档案-体重值、5-健康档案-血压值 6-健康档案-血糖值 7-健康档案步数 8-健康档案经期 9-视乎等待 10-天呈百科-药品 11-天呈百科疾病 12-环保banner 13-活动入口图)
    fun getAdByType(advertType: String): Observable<BaseResp<AdvertizimentRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getAdByType(advertType)
    }
    fun getAdByCode(code: String): Observable<BaseResp<List<AdvertiseRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getAdByCode(code)
    }
    fun getAdByType2(advertType: String): Observable<BaseResp<AdvertizimentRes2>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getAdByType2(advertType)
    }

    fun getInvoiceOrders(): Observable<BaseResp<List<InvoiceRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getInvoiceOrders()
    }

    fun getIndexRemind(
        familyId: String,
        remindType: String,
        userId: String
    ): Observable<BaseResp<List<IndexRemindRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getIndexRemind(familyId, remindType, userId)
    }

    fun addInvoice(addInvoiceReq: AddInvoiceReq): Observable<BaseResp<Boolean>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .addInvoice(getRequestJsonBody(addInvoiceReq))
    }

    fun getInvoicesPage(pageNum: Int, pageSize: Int): Observable<BaseResp<InvoicePageRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getInvoicesPage(pageNum, pageSize)
    }

    fun getInvoiceDetail(invoiceId: String): Observable<BaseResp<InvoiceDetail>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getInvoiceDetail(invoiceId)
    }

    fun getSaleDetail(afterSaleNum: String): Observable<BaseResp<GetSaleDetail>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getSaleDetail(afterSaleNum)
    }

    fun fillOrderNumber(fillNumberReq: GetSaleDetail): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .fillOrderNumber(getRequestJsonBody(fillNumberReq))
    }

    fun selectPricesByIds(changePriceReq: ChangePriceReq): Observable<BaseResp<List<ChangePriceRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .selectPricesByIds(getRequestJsonBody(changePriceReq))
    }

    fun getProtcol(userId: String): Observable<BaseResp<String>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getProtcol(userId)
    }

    fun updateProtcol(proctolReq: ProctolReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .updateProtcol(getRequestJsonBody(proctolReq))
    }

    fun getInquiryRecord(
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<HealthInquiryRecordRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getInquiryRecord(pageNum, pageSize)
    }

    fun getInquiryRecordDetail(doctorTableId: Long): Observable<BaseResp<HealthInquiryRecordRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getInquiryRecordDetail(doctorTableId)
    }

    fun getHealthOrderRecordsUsing(pageNum: Int, pageSize: Int):
            Observable<BaseResp<DataListRes<HealthRecordItemRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getHealthOrderRecordsUsing(pageNum, pageSize)
    }

    fun getAppVersion(version: String): Observable<BaseResp<GetVersionRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getAppVersion("ca", version + "_Android")
    }

    fun addUserRecordFromAPP(addUserRecordReq: AddUserRecordReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .addUserRecordFromAPP(getRequestJsonBody(addUserRecordReq))
    }

    fun unlockTimes(doctorTableId: String?): Observable<BaseResp<Any?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .unlockTimes(doctorTableId)
    }

    fun getCustomerDoctorInfo(imuserId: String): Observable<BaseResp<CustomerDoctorInfoRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getCustomerDoctorInfo(imuserId)
    }

    fun cancelQueue(doctorTableId: String?): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .cancelQueue(doctorTableId)
    }

    fun confirmQueueSuccessful(doctorTableId: String?, type: Int): Observable<BaseResp<Any?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .confirmQueueSuccessful(doctorTableId, type)
    }

    fun getHelpCentreInfo(): Observable<BaseResp<ArrayList<HelpCentreRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getHelpCentreInfo()
    }

    fun getServiceProtocolList(): Observable<BaseResp<ArrayList<ServiceProtocolRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getServiceProtocolList()
    }

    fun getServiceProtocolDetail(agreementId: String): Observable<BaseResp<ServiceProtocolRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getServiceProtocolDetail(agreementId)
    }

    fun getCommontProtocol(agreementId: String): Observable<BaseResp<ServiceProtocolRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getCommontProtocol(agreementId)
    }

    fun addNoDisturbCircle(groupIdIm: String): Observable<BaseResp<Any>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .addNoDisturbCircle(groupIdIm)
    }

    fun cancelMesDisturb(groupIdIm: String): Observable<BaseResp<Any>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .cancleMesDisturb(groupIdIm)
    }

    fun getAllDisturbMsgId(): Observable<BaseResp<ArrayList<String>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getAllDisturbMsgId()
    }

    fun addCallLog(addCallLogReq: AddCallLogReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .addCallLog(getRequestJsonBody(addCallLogReq))
    }

    fun addEvaluate(evaluateReq: EvaluateReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .addEvaluate(getRequestJsonBody(evaluateReq))
    }

    fun getEvaluate(doctorTableId: String): Observable<BaseResp<List<SubjectRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getEvaluate(doctorTableId)
    }

    fun getSubjects(): Observable<BaseResp<List<SubjectRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getSubjects()
    }


    fun getConsultationTime(): Observable<BaseResp<VipDurationRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getConsultationTime()
    }

    fun selectActivity(): Observable<BaseResp<OfferLoveActiveRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .selectActivity()
    }

    fun topEight(): Observable<BaseResp<List<ActiveDoneeRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .topEight()
    }


    fun activeCheckPay(activityId: Long): Observable<BaseResp<String>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .activeCheckPay(activityId)
    }

    fun activeCreateOrder(activeCreateOrderReq: ActiveCreateOrderReq): Observable<BaseResp<ActiveCreateOrderRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .activeCreateOrder(getRequestJsonBody(activeCreateOrderReq))
    }

    fun activePayOrder(payOrderReq: PayOrderReq): Observable<BaseResp<String>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .activePayOrder(getRequestJsonBody(payOrderReq))
    }

    fun getCountWithOutGive(): Observable<BaseResp<Int>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getCountWithOutGive()
    }

    fun activeReleaseAll(activeReleaseReq: ActiveReleaseReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .activeReleaseAll(getRequestJsonBody(activeReleaseReq))
    }

    fun getActivityList(
        giveId: String,
        pageNum: Int,
        pageSize: Int,
        payId: String
    ): Observable<BaseResp<ActivityOrdersRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getActivityList(giveId, pageNum, pageSize, payId)
    }

    fun getActivityDetail(orderNum: String): Observable<BaseResp<ActivityOrderDetailRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getActivityDetail(orderNum)
    }

    fun sureReceive(sureReceiveReq: SureReceiveReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .sureReceive(getRequestJsonBody(sureReceiveReq))
    }

    fun getGiverOrderList(pageNum: Int, pageSize: Int): Observable<BaseResp<GiverOrderRecoedRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getGiverOrderList(pageNum, pageSize)
    }

    fun getLogistics(waybillId: String, waybillNum: String,receivingPhone: String): Observable<BaseResp<LogisticRes3>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getLogistics(waybillId, waybillNum,receivingPhone)
    }

    fun applyGift(req: ApplyGiftReq): Observable<BaseResp<Long>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .applyGift(getRequestJsonBody(req))
    }

    fun getRankData(): Observable<BaseResp<RankDataRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getRankData()
    }

    fun getOrderPayState(orderNum: String): Observable<BaseResp<Int>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getOrderPayState(orderNum)
    }

    fun applyShare(applyId: String): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .applyShare(applyId)
    }

    fun getLastGetLoveInfo(): Observable<BaseResp<LastGetLoveInfoRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getLastGetLoveInfo()
    }

    fun getLotteryTaskList(activityId: String): Observable<BaseResp<LotteryTask>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getLotteryTaskList(activityId)
    }

    fun getLotteryRecord(
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<LotteryRecordRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getLotteryRecord(pageNum, pageSize)
    }

    fun updateRecordConsigneeInfo(lotteryRecordReq: LotteryRecordReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .updateRecordConsigneeInfo(getRequestJsonBody(lotteryRecordReq))
    }

    fun completeFirstVideo(): Observable<BaseResp<Any>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .completeFirstVideo()
    }

    fun isFriend(customerAccount: String): Observable<BaseResp<IsFriendRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .isFriend(customerAccount)
    }

    fun getLastRecord(): Observable<BaseResp<LastRecordRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getLastRecord()
    }


    fun verificationBeforeJoinQueue(
        familyId: Long?,
        departmentId: Long?
    ): Observable<BaseResp<Any>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .verificationBeforeJoinQueue(familyId, departmentId)
    }

    fun authen(
        idNo: String,
        name: String,
        userId: String? = null
    ): Observable<BaseResp<AuthenticationRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .authen(getRequestJsonBody(AuthenDataReq(idNo = idNo, name = name, userId = userId)))
    }

    fun userIdenAuthenInfo(): Observable<BaseResp<UserIdenAuthenInfo?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .userIdenAuthenInfo()
    }

    fun getSetMeal(): Observable<BaseResp<CircleSetMealRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getSetMeal()
    }


    fun isAuthen(): Observable<BaseResp<Boolean?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .isAuthen()
    }

    fun isForbidenVideo(userId: String): Observable<BaseResp<Any>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .isForbidenVideo(userId)
    }

    fun recommendImGroupContent(): Observable<BaseResp<MainRecommodRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .recommendImGroupContent()
    }

    /**
     * 根据标签搜索相关圈子
     */
    fun getImGroupByLabel(label: String, pageNumber: Int, pageSize: Int):
            Observable<BaseResp<DataListRes<CircleWithTagReq>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getImGroupByLabel(label, pageNumber, pageSize)
    }

    /**
     * 根据标签搜索相关内容
     */
    fun getContentByLabel(label: String, pageNumber: Int, pageSize: Int):
            Observable<BaseResp<DataListRes<ContentBaseEntity>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getContentByLabel(label, pageNumber, pageSize)
    }

    /**
     * 删除健康记录
     */
    fun deleteHealthRecord(id: String): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .deleteHealthRecord(id)
    }

    /**
     * 获取健康百科一级栏目
     */
    fun getFirstWikiLevel(wikiType: Int): Observable<BaseResp<ArrayList<String?>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getFirstWikiLevel(wikiType)
    }

    fun getSecondWikiLevel(firstLevelName: String, wikiType: Int, pageNum: Int, pageSize: Int):
            Observable<BaseResp<DataListRes<WikiSecondDataRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getSecondWikiLevel(firstLevelName, wikiType, pageNum, pageSize)
    }

    fun getSicknessDetail(sicknessId: String): Observable<BaseResp<SicknessDetailRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getSicknessDetail(sicknessId)
    }

    fun getRecommendForDisease(diseaseId: String?): Observable<BaseResp<SicknessRelatedRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getRecommendForDisease(diseaseId)
    }

    fun getMedicineDetail(medicineId: String): Observable<BaseResp<MedicineDetailRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getMedicineDetail(medicineId)
    }

    fun getMedicalRecommend(
        mId: String?,
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<GetShopRecommendRes.Data>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getMedicalRecommend(mId, pageNum, pageSize)
    }

    fun getResultByNames(name: String, wikiType: Int, pageNum: Int, pageSize: Int):
            Observable<BaseResp<DataListRes<WikiSecondDataRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getResultByNames(name, wikiType, pageNum, pageSize)
    }

    fun getNoticeList(date: String): Observable<BaseResp<ArrayList<DailyNoticeRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getNoticeList(date)
    }

    fun getPlanList(type: String, pageNum: Int, pageSize: Int):
            Observable<BaseResp<DataListRes<MedicineUsagePlanRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getPlanList(type, pageNum, pageSize)
    }

    fun createMedicineUsagePlan(requestObj: CreateMedicineUsagePlanReq): Observable<BaseResp<String?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .createMedicineUsagePlan(getRequestJsonBody(requestObj))
    }

    fun getNoticeListByPlanId(planId: String): Observable<BaseResp<ArrayList<MedicineUsageNoticeWithDay>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getNoticeListByPlanId(planId)
    }

    fun getNoticeListByPlanId2(planId: String): Observable<BaseResp<MedicineUsageNoticeWithPlan2>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getNoticeListByPlanId2(planId)
    }

    fun getNoticeListByUserId(): Observable<BaseResp<ArrayList<MedicineUsageNoticeWithPlan2>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getNoticeListByUserId()
    }

    fun getPlanRecord(planId: String): Observable<BaseResp<MedicineUsageRecordRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getPlanRecord(planId)
    }

    fun getPlanDetail(planId: String): Observable<BaseResp<MedicineUsagePlanDetailRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getPlanDetail(planId)
    }

    fun deletePlan(planId: String): Observable<BaseResp<Any?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .deletePlan(planId)
    }

    fun discontinuePlan(planId: String, reason: String): Observable<BaseResp<Any?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .discontinuePlan(planId, reason)
    }

    fun getNoticeDetail(
        planId: String,
        num: String
    ): Observable<BaseResp<MedicineUsageNoticeDetailRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getNoticeDetail(planId, num)
    }

    fun getNotices(requestBody: RequestBody): Observable<BaseResp<ArrayList<MedicineUsageNoticeDetailRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getNotices(requestBody)
    }

    fun updateNoticeState(request: UpdateNoticeReq): Observable<BaseResp<Boolean?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .updateNoticeState(getRequestJsonBody(request))
    }

    fun getMedicineUsageNotice(userId: String): Observable<BaseResp<ArrayList<DailyNoticeRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getMedicineUsageNotice(userId)
    }

    fun inputMedicine(inputMedicineReq: InputMedicineReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .inputMedicine(getRequestJsonBody(inputMedicineReq))
    }

    fun deleteMedicine(id: String): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .deleteMedicine(id)
    }

    fun findBarByCode(barCode: String):
            Observable<BaseResp<MedicineDetailsRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .findBarByCode(barCode)
    }

    fun findMedicineByName(name: String, pageNum: Int, pageSize: Int):
            Observable<BaseResp<MedicineSearchRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .findMedicineByName(name, pageNum, pageSize)
    }

    fun getMedicineDetails(id: String):
            Observable<BaseResp<MedicineAllDetailRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getMedicineDetails(id)
    }

    fun getFamilyMedicineList(
        familyId: String,
        pageNum: Int,
        pageSize: Int,
        type: String
    ):
            Observable<BaseResp<List<FamilyMedicineListRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getFamilyMedicineList(familyId, type)
    }

    fun getMedicineTypes(familyId: String):
            Observable<BaseResp<List<MedicineKindRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getMedicineTypes(familyId)
    }

    fun shopCancelOrder(req: ShopGetOrderDetailsRes): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .shopCancelOrder(getRequestJsonBody(req))
    }

    fun shopSureReceive(shopConfirmReceiveReq: ShopGetOrderDetailsRes): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .shopSureReceive(getRequestJsonBody(shopConfirmReceiveReq))
    }

    fun shopSubmitOrder(shopSubmitOrderReq: ShopCheckPayReq): Observable<BaseResp<ShopCreateOrderRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .shopSubmitOrder(getRequestJsonBody(shopSubmitOrderReq))
    }

    fun shopDeleteOrder(shopConfirmReceiveReq: ShopGetOrderDetailsRes): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .shopDeleteOrder(getRequestJsonBody(shopConfirmReceiveReq))
    }

    fun shopPayOrder(shopPayReq: ShopCreateOrderRes): Observable<BaseResp<String>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .shopPayOrder(getRequestJsonBody(shopPayReq))
    }

    fun shopGetOrderDetails(orderNum: String):
            Observable<BaseResp<ShopGetOrderDetailsRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .shopGetOrderDetails(orderNum)
    }

    fun shopGetOrderList(
        pageNum: Int?,
        pageSize: Int?,
        type: String?,
        status: String?
    ):
            Observable<BaseResp<DataListRes<ShopGetOrderDetailsRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .shopGetOrderList(pageNum, pageSize, type, status)
    }

    fun shopGetLogisticInfo(waybillId: String, waybillNum: String,receivingPhone:String):
            Observable<BaseResp<ShopLogisticsRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .shopGetLogisticInfo(waybillId, waybillNum,receivingPhone)
    }

    fun shopRefusePay(shopRefusePayReq: ShopRefusePayReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .shopRefusePay(getRequestJsonBody(shopRefusePayReq))
    }

    fun shopSearchGood(
        pageNum: Int,
        pageSize: Int,
        name: String
    ):
            Observable<BaseResp<ShopSearchRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .shopSearchGood(pageNum, pageSize, name)
    }

    fun shopGetGoodDetails(
        commodityId: String,
        areaId: String
    ):
            Observable<BaseResp<ShopGoodRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .shopGetGoodDetails(commodityId, areaId)
    }

    fun shopDeleteCar(commodityMongoDTOList: ShopDeleteCarReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .shopDeleteCar(getRequestJsonBody(commodityMongoDTOList))
    }

    fun shopAddShopCar(shopAddCarReq: ShopAddCarReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .shopAddShopCar(getRequestJsonBody(shopAddCarReq))
    }

    fun shopGetShopCar(
        userId: String,
        areaId: String
    ):
            Observable<BaseResp<List<ShopGetCarsRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .shopGetShopCar(userId, areaId)
    }

    fun shopEditShopCar(shopEditCarReq: ShopGoodRes):
            Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .shopEditShopCar(getRequestJsonBody(shopEditCarReq))
    }

    fun shopCheckPay(shopCheckPayReq: ShopCheckPayReq):
            Observable<BaseResp<ShopCheckPayRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .shopCheckPay(getRequestJsonBody(shopCheckPayReq))
    }

    fun getHuoDongList(
        status: Int,
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<HuoDongRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getHuoDongList(status, pageNum, pageSize)

    }

    fun getShopSecondClassGoods(
        pageNum: Int,
        pageSize: Int,
        price: String,
        firstClassifyId: String,
        secondClassifyId: String,
        sell: String
    ): Observable<BaseResp<GetShopRecommendRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getShopSecondClassGoods(
                pageNum,
                pageSize,
                price,
                firstClassifyId,
                secondClassifyId,
                sell
            )

    }

    fun getShopFirstClass(): Observable<BaseResp<List<GetShopFirstClassRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getShopFirstClass()

    }


    fun getShopRecommend(
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<GetShopRecommendRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getShopRecommend(pageNum, pageSize)

    }

    fun getShopSecondClass(
        firstClassifyId: String
    ): Observable<BaseResp<List<GetShopFirstClassRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getShopSecondClass(firstClassifyId)

    }

    fun getShopCarCount(): Observable<BaseResp<Long>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getShopCarCount()
    }


    fun bindMedicineBox(req: ChestInfoRes):
            Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .bindMedicineBox(getRequestJsonBody(req))
    }

    fun changeMedicineStatus(req: ChangeChestStatusReq):
            Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .changeMedicineStatus(getRequestJsonBody(req))
    }

    fun addFamily(req: GetBindFamilyRes):
            Observable<BaseResp<Long>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .addFamily(getRequestJsonBody(req))
    }

    fun getChestInfo(
        sn: String
    ): Observable<BaseResp<ChestInfoRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getChestInfo(sn)

    }

    fun getChestInfoByFamily(
        familyId: String
    ): Observable<BaseResp<ChestInfoRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getChestInfoByFamily(familyId)

    }

    fun getBindFamily(
    ): Observable<BaseResp<GetBindFamilyRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getBindFamily()
    }

    fun updateChestInfo(req: ChestInfoRes):
            Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .updateChestInfo(getRequestJsonBody(req))
    }

    fun applyForLiveSteaming(liveStreaming: LiveStreamingEntity): Observable<BaseResp<String?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .applyForLiveSteaming(getRequestJsonBody(liveStreaming))
    }

    fun modifyLiveStreamMaterial(liveStreaming: LiveStreamingEntity): Observable<BaseResp<String?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .modifyLiveStreamMaterial(getRequestJsonBody(liveStreaming))
    }

    fun applyForExpertCircleOwner(request: ExpertCircleOwnerReq): Observable<BaseResp<String?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .applyForExpertCircleOwner(getRequestJsonBody(request))
    }

    fun getExpertQualificateDetail(userId: String): Observable<BaseResp<ExpertQualificateDetailRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getExpertQualificateDetail(userId)
    }

    fun applyForAnchor(anchorEntity: AnchorEntity): Observable<BaseResp<String?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .applyForAnchor(getRequestJsonBody(anchorEntity))
    }

    fun getAnchorByUserId(): Observable<BaseResp<AnchorStateRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getAnchorByUserId()
    }

    fun getMyLiveStream(): Observable<BaseResp<MyLiveStreamRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getMyLiveStream()
    }

    fun gitLiveStreamHistory(
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<LiveStreamingEntity>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .gitLiveStreamHistory(pageNum, pageSize)
    }

    fun getLiveStreamDetail(liveId: Long?): Observable<BaseResp<LiveStreamingEntity>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getLiveStreamDetail(liveId)
    }

    fun closeLiveStream(request: CloseLiveStreamReq): Observable<BaseResp<Boolean>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .closeLiveStream(getRequestJsonBody(request))
    }

    fun checkBeforeSpecialCircle(): Observable<BaseResp<Int?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .checkBeforeSpecialCircle()
    }

    fun getHotAndPrecast(): Observable<BaseResp<HotAndPrecastRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getHotAndPrecast()
    }

    fun getClassifyList(
        state: Int,
        pageNum: Int,
        pageSize: Int,
        keyWord: String?
    ): Observable<BaseResp<DataListRes<LiveStreamingEntity>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getClassifyList(state, pageNum, pageSize, keyWord)
    }

    fun reserveLiveStream(type: String, liveId: String): Observable<BaseResp<Int>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .reserveLiveStream(type, liveId)
    }

    fun createLiveStreamOrder(request: CreateLiveStreamOrderReq): Observable<BaseResp<CreateLiveStreamOrderRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .createLiveStreamOrder(getRequestJsonBody(request))
    }

    fun createCircleOrder(request: CreateCircleOrderReq): Observable<BaseResp<CreateLiveStreamOrderRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .createCircleOrder(getRequestJsonBody(request))
    }

    fun liveAuthority(liveId: Long?): Observable<BaseResp<Int>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .liveAuthority(liveId)
    }

    fun getLiveOrderDetail(orderNum: String?): Observable<BaseResp<CreateLiveStreamOrderReq>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getLiveOrderDetail(orderNum)
    }

    fun getCircleOrderDetail(orderNum: String?): Observable<BaseResp<CreateCircleOrderReq>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getCircleOrderDetail(orderNum)
    }

    fun getLiveOrderList(
        pageSize: Int,
        pageNum: Int
    ): Observable<BaseResp<DataListRes<CreateLiveStreamOrderReq>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getLiveOrderList(pageSize, pageNum)
    }

    fun getCircleOrderList(
        pageSize: Int,
        pageNum: Int
    ): Observable<BaseResp<DataListRes<CreateCircleOrderReq>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getCircleOrderList(pageSize, pageNum)
    }

    fun deleteLiveOrder(orderNum: String?): Observable<BaseResp<String?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .deleteLiveOrder(orderNum)
    }

    fun deleteCircleOrder(orderNum: String?): Observable<BaseResp<Boolean?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .deleteCircleOrder(orderNum)
    }

    fun getMedicalList(
        pageSize: Int,
        pageNum: Int,
        cityId: String,
        oneDepartment: String,
        department: String,
        orderRule: String
    ): Observable<BaseResp<ExpertListRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getMedicalList(pageSize, pageNum, cityId, oneDepartment, department, orderRule)
    }

    fun getMedicalDepartment(): Observable<BaseResp<List<ExpertDepartmentRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getMedicalDepartment()
    }

    fun getMedicalDetail(medicalCommodityId: String): Observable<BaseResp<ExpertDetailRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getMedicalDetail(medicalCommodityId)
    }

    fun getRecommendList(): Observable<BaseResp<List<ExpertRecommendRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getRecommendList()
    }


    fun cancelExpertOrder(request: ExpertOrderDetailRes): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .cancelExpertOrder(getRequestJsonBody(request))
    }

    fun expertRefusePay(request: ExpertRefusePayReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .expertRefusePay(getRequestJsonBody(request))
    }

    fun postCheckOrder(
        type: Int,
        doctorId: String,
        medicalCommodityId: String
    ): Observable<BaseResp<String>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .postCheckOrder(type,doctorId, medicalCommodityId)
    }

    fun createExpertOrder(request: ExpertCreateOrderReq): Observable<BaseResp<ExpertOrderRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .createExpertOrder(getRequestJsonBody(request))
    }

    fun deleteExpertOrder(request: ExpertOrderDetailRes): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .deleteExpertOrder(getRequestJsonBody(request))
    }

    fun expertDoPay(request: ExpertOrderRes): Observable<BaseResp<String>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .expertDoPay(getRequestJsonBody(request))
    }

    fun expertOrderEvalution(request: ExpertOrderDetailRes): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .expertOrderEvalution(getRequestJsonBody(request))
    }

    fun getExpertPatientList(familyId: String): Observable<BaseResp<List<ExpertFamilyPatientRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getExpertPatientList(familyId)
    }

    fun getEvalutionList(
        doctorId: String,
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<GetEvalutionsRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getEvalutionList(doctorId, pageNum, pageSize)
    }

    fun expertFinishOrder(request: ExpertFinishOrderReq): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .expertFinishOrder(getRequestJsonBody(request))
    }

    fun callbackConfirm(
        doctorTableId: String?,
        uniqueMark: String?
    ): Observable<BaseResp<Boolean?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .callbackConfirm(doctorTableId, uniqueMark)
    }

    fun getExpertLatestOrder(
        doctorId: String,
        patientId: String
    ): Observable<BaseResp<ExpertOrderDetailRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getExpertLatestOrder(doctorId, patientId)
    }

    fun getExpertOrderDetail(orderNum: String): Observable<BaseResp<ExpertOrderDetailRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getExpertOrderDetail(orderNum)
    }

    fun getExpertOrderList(
        pageNum: Int,
        pageSize: Int,
        status: String
    ): Observable<BaseResp<ExpertOrderListRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getExpertOrderList(pageNum, pageSize, status)
    }

    fun expertSavePatient(request: ExpertFamilyPatientRes): Observable<BaseResp<ExpertFamilyPatientRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .expertSavePatient(getRequestJsonBody(request))
    }

    fun openLiveStream(request: ChatRoomReq): Observable<BaseResp<ChatRoomRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .openLiveStream(getRequestJsonBody(request))
    }

    fun getPublishStreamUrl(liveRoomId: String?): Observable<BaseResp<StreamUrlRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getPublishStreamUrl(liveRoomId)
    }

    fun getPlayStreamUrl(liveRoomId: String?): Observable<BaseResp<StreamUrlRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getPlayStreamUrl(liveRoomId)
    }

    fun getLiveRoomDetail(liveRoomId: String?): Observable<BaseResp<ChatRoomRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getLiveRoomDetail(liveRoomId)
    }

    fun liveException(): Observable<BaseResp<LiveStreamingEntity>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .liveException()
    }

    fun getLiveStreamDetail2(liveId: Long?): Observable<BaseResp<LiveStreamingEntity>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getLiveStreamDetail2(liveId)
    }

    fun livePermissions(): Observable<BaseResp<Boolean?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .livePermissions()
    }


    fun getCardInfo(serialNumber: String): Observable<BaseResp<VideoCardInfoRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getCardInfo(serialNumber)
    }
    fun getOrderStatus(orderNum: String): Observable<BaseResp<String>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getOrderStatus(orderNum)
    }
    fun getRechargeGoods(): Observable<BaseResp<List<RechargrGoodRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getRechargeGoods()
    }

    fun getRechargeHistory(
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<RechargeHisRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getRechargeHistory(pageNum, pageSize)
    }

    fun rechargeCard(request: CardRechargeReq): Observable<BaseResp<Int>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .rechargeCard(getRequestJsonBody(request))
    }

    fun videoRechargeCreateOrder(request: VideoRechargeOrderReq): Observable<BaseResp<VideoRechargeRes?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .videoRechargeCreateOrder(getRequestJsonBody(request))
    }

    fun getCardTimes(): Observable<BaseResp<Int>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getCardTimes()
    }

    fun getCallUsageRecordList(
        id: Long?,
        pageNum: Int?,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<CallUsageRecordRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getCallUsageRecordList(id, pageNum, pageSize)
    }

    fun findByMedicalId(medicalId: String): Observable<BaseResp<String>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .findByMedicalId(medicalId)
    }

    fun sendVisualCallTimes(request: SendVisualCallReq): Observable<BaseResp<Boolean?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .sendVisualCallTimes(getRequestJsonBody(request))
    }

    fun getDepartments(familyId: Long?): Observable<BaseResp<DepartmentsRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getDepartments(familyId)
    }

    fun getDoorCareMedicalList(
        cityId: String?,
        latitude: String?,
        longitude: String?,
        orderRule: String?,
        pageNum: Int?,
        pageSize: Int?,
        projectId: String?
    ): Observable<BaseResp<DataListRes<DoorCareRemandListRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getDoorCareMedicalList(
                cityId,
                latitude,
                longitude,
                orderRule,
                pageNum,
                pageSize,
                projectId
            )
    }

    fun getDoorCareMedicalDetail(medicalCommodityId: String?): Observable<BaseResp<GetDoorCarDetailRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getDoorCareMedicalDetail(medicalCommodityId)
    }

    fun getDoorCareProjects(): Observable<BaseResp<List<GetDoorCareProjectsRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getDoorCareProjects()
    }

    fun getDoorCareRemandMedicals(
        latitude: String?,
        longitude: String?
    ): Observable<BaseResp<List<DoorCareRemandListRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getDoorCareRemandMedicals(latitude, longitude)
    }

    fun getDoorCareTwoList(
    ): Observable<BaseResp<List<DoorCareTwoProjectRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getDoorCareTwoList()
    }

    fun doorCareCancelOrder(request: DoorCareOrderListRes.Data): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .doorCareCancelOrder(getRequestJsonBody(request))
    }

    fun getDoorCareChoiceTime(
        date: String?,
        medicalId: String?,
        projectId: String?
    ): Observable<BaseResp<List<GetDoorCareTimeRes>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getDoorCareChoiceTime(date, medicalId, projectId)
    }

    fun getDoorCareCheckTime(
        appointmentTime: String?,
        doctorId: String?,
        projectId: String?
    ): Observable<BaseResp<Boolean>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getDoorCareCheckTime(appointmentTime, doctorId, projectId)
    }

    fun doorCareCreateOrder(request: DoorCareCreateOrderReq): Observable<BaseResp<DoorCareCreateOrderRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .doorCareCreateOrder(getRequestJsonBody(request))
    }

    fun doorCareDeleteOrder(request: DoorCareOrderListRes.Data): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .doorCareDeleteOrder(getRequestJsonBody(request))
    }

    fun doorCarePay(request: DoorCareCreateOrderRes): Observable<BaseResp<String>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .doorCarePay(getRequestJsonBody(request))
    }

    fun doorCareEvalution(request: DoorCareOrderListRes.Data): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .doorCareEvalution(getRequestJsonBody(request))
    }


    fun doorCareGetEvalutionList(
        doctorId: String?,
        pageNum: Int?,
        pageSize: Int
    ): Observable<BaseResp<DoorCareEvalutionsRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .doorCareGetEvalutionList(doctorId, pageNum, pageSize)
    }

    fun doorCareGetDoctorPhone(doctorId: String?): Observable<BaseResp<String>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .doorCareGetDoctorPhone(doctorId)
    }

    fun doorCareGetMedicalGood(medicalId: String?): Observable<BaseResp<String>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .doorCareGetMedicalGood(medicalId)
    }

    fun doorCareGetOrderDetail(orderNum: String?): Observable<BaseResp<DoorCareOrderListRes.Data>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .doorCareGetOrderDetail(orderNum)
    }

    fun doorCareGetOrders(
        pageNum: Int?,
        pageSize: Int,
        status: String
    ): Observable<BaseResp<DoorCareOrderListRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .doorCareGetOrders(pageNum, pageSize, status)
    }

    fun uploadCaseHistory(request: AddCaseHistoryReq): Observable<BaseResp<Long?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .uploadCaseHistory(getRequestJsonBody(request))
    }

    fun getCaseHistoryList(familyId: Long?, pageNum: Int, pageSize: Int):
            Observable<BaseResp<DataListRes<AddCaseHistoryReq>>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getCaseHistoryList(familyId, pageNum, pageSize)
    }

    fun deleteCaseHistory(medicalRecordId: Long?):
            Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .deleteCaseHistory(medicalRecordId)
    }

    fun checkMedicineBindStatus(sn: String): Observable<BaseResp<Boolean>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .checkMedicineBindStatus(sn)
    }

    fun scanCodeLoginChest(sn: String, ts: String): Observable<BaseResp<Any>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .scanCodeLoginChest(sn, ts)
    }

    fun getChestBaseInfo(sn: String, ts: String): Observable<BaseResp<ChestBaseInfoRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getChestBaseInfo(sn, ts)
    }

    /**
     * 呼叫前校验接听方是虚拟用户还是真实用户，如果是真实用户，则由自己发送环信消息给接听方
     * 如果是虚拟用户，则后台通过mqtt发送邀请消息到药箱
     */
    fun callPreJudgment(request: MedicineVideoConversationReq): Observable<BaseResp<CallPreJudgmentRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .callPreJudgment(getRequestJsonBody(request))
    }

    fun cancelWithMQTT(
        sn: String?,
        meetingId: String?,
        myUserImId: String?,
        toUserImId: String?
    ): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .cancelWithMQTT(sn, meetingId, myUserImId, toUserImId)
    }

    fun applyForDonate(requestObj: DonateRequest): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .applyForDonate(getRequestJsonBody(requestObj))
    }

    fun getUserByTel(phone: String): Observable<BaseResp<FamilyGetUserByTelRes>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getUserByTel(phone)
    }

    fun getFamilyGuardian(familyId: String): Observable<BaseResp<String>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getFamilyGuardian(familyId)
    }


    fun familySendInviteInfo(
        familyId: String,
        role: String,
        userId: String
    ): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .familySendInviteInfo(familyId, role, userId)
    }

    fun familySendSms(phone: String): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .familySendSms(phone)
    }

    fun getIsExist(familyId: String, phone: String): Observable<BaseResp<Boolean>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getIsExist(familyId, phone)
    }

    fun getRedPoint(): Observable<BaseResp<RedPoint>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getRedPoint()
    }

    fun deleteRedPoint(key: String): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .deleteRedPoint(key)
    }

    fun getUserOcrInfo(): Observable<BaseResp<UserIdenAuthenInfo?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .getUserOcrInfo()
    }

    fun auth(authParam: AuthParam): Observable<BaseResp<UserIdenAuthenInfo?>> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .auth(getRequestJsonBody(authParam))
    }

    fun updateAuth(userIdenAuthenInfo: UserIdenAuthenInfo): Observable<EmptyResp> {
        return RetrofitFactory.instance
            .createApiService(TianChenHealthyApi::class.java)
            .updateAuth(getRequestJsonBody(userIdenAuthenInfo))
    }
}